home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / DMTDEMOS / MOVEFILE.DEM < prev    next >
Text File  |  1994-07-02  |  596b  |  35 lines

  1. program MoveFileSample;
  2.  
  3.  uses crt, DMT;
  4.  
  5.  var
  6.    FileName,
  7.    TargetPath : string;
  8.  
  9. begin
  10.   FileName   := '';
  11.   TargetPath := '';
  12.  
  13.   Color( 7, 0 );
  14.   clrscr;
  15.   write( 'Enter filename to move : ' );
  16.   readln( FileName );
  17.  
  18.   write( 'Enter target directory : ' );
  19.   readln( TargetPath );
  20.  
  21.   MoveFile( FileName, TargetPath );    { Call MoveFile procedure ]}
  22.  
  23.   if ( ErrFlag ) then
  24.     begin
  25.       writeln( #7 );
  26.       writeln( ShowError( GetErrCode ) );
  27.     end
  28.   else
  29.     begin
  30.       writeln;
  31.       writeln( 'File successfully moved.' );
  32.     end;
  33.  
  34.   GetEnter;
  35. end.